package com.sora.controller.api;

import com.sora.model.param.RegisterParam;
import com.sora.model.vo.ResultVO;
import com.sora.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@Api(value = "注册接口")
@RestController
@RequestMapping("api")
public class RegisterController {

    @Resource
    UserService userService;

    @ApiOperation(value = "用户通过账户密码注册--sora")
    @PostMapping("/register")
    public ResultVO register(@RequestBody @Valid RegisterParam param) {
        return userService.register(param);
    }
}
